package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcLog;
import com.visizen.wisdomclass.server.model.WcLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcLogMapper {
    @SelectProvider(type=WcLogSqlProvider.class, method="countByExample")
    int countByExample(WcLogExample example);

    @DeleteProvider(type=WcLogSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcLogExample example);

    @Delete({
        "delete from wc_log",
        "where LOG_ID = #{LOG_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long LOG_ID);

    @Insert({
        "insert into wc_log (LOG_ID, OP_ID, ",
        "OP_TYPE, CONTENT, ",
        "OP_TIME)",
        "values (#{LOG_ID,jdbcType=BIGINT}, #{OP_ID,jdbcType=BIGINT}, ",
        "#{OP_TYPE,jdbcType=BIGINT}, #{CONTENT,jdbcType=VARCHAR}, ",
        "#{OP_TIME,jdbcType=TIMESTAMP})"
    })
    int insert(WcLog record);

    @InsertProvider(type=WcLogSqlProvider.class, method="insertSelective")
    int insertSelective(WcLog record);

    @SelectProvider(type=WcLogSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="LOG_ID", property="LOG_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="OP_ID", property="OP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="OP_TYPE", property="OP_TYPE", jdbcType=JdbcType.BIGINT),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="OP_TIME", property="OP_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    List<WcLog> selectByExample(WcLogExample example);

    @Select({
        "select",
        "LOG_ID, OP_ID, OP_TYPE, CONTENT, OP_TIME",
        "from wc_log",
        "where LOG_ID = #{LOG_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="LOG_ID", property="LOG_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="OP_ID", property="OP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="OP_TYPE", property="OP_TYPE", jdbcType=JdbcType.BIGINT),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="OP_TIME", property="OP_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    WcLog selectByPrimaryKey(Long LOG_ID);

    @UpdateProvider(type=WcLogSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcLog record, @Param("example") WcLogExample example);

    @UpdateProvider(type=WcLogSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcLog record, @Param("example") WcLogExample example);

    @UpdateProvider(type=WcLogSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcLog record);

    @Update({
        "update wc_log",
        "set OP_ID = #{OP_ID,jdbcType=BIGINT},",
          "OP_TYPE = #{OP_TYPE,jdbcType=BIGINT},",
          "CONTENT = #{CONTENT,jdbcType=VARCHAR},",
          "OP_TIME = #{OP_TIME,jdbcType=TIMESTAMP}",
        "where LOG_ID = #{LOG_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcLog record);
}